<template>
  <div class="footer">
    <h1>我是Footer</h1>
    <p>count的值是{{count}}</p>
    <h2>电影的数量{{movieList.length}}</h2>
    <button @click="increment">累加</button>
    <button @click="decrement">累减</button>
    <button @click="incrementN({n:3})">累加n</button>
    <button @click="incrementWait">等一等再加</button>
    <button @click="incrementNWait({n:5})">等一等再加n</button>
  </div>
</template>

<script>
import { mapActions, mapMutations, mapState } from 'vuex'
export default {
name:'Footer',
computed:{
    //1.mapState的数组写法,直接把store的state的数据名称 作为计算属性的名称
    // ...mapState(["count"]),

    //2.mapState的对象写法,可以规定计算属性的名称
   ...mapState(['count','movieList'])
},
methods:{
    ...mapMutations(['increment','decrement','incrementN']),
    ...mapActions(['incrementWait','incrementNWait'])
}
}
</script>

<style scoped>
.footer {
  margin: 30px;
  background: palevioletred;
}
</style>